﻿using System;
using System.Windows.Data;

namespace AnthStat.WPF.Applications.Converters
{
    public class GrowthReferenceToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string reference = value.ToString();

            string objectReference = parameter.ToString();

            if (reference.Equals("CDC", StringComparison.OrdinalIgnoreCase) && objectReference.Equals("CDC", StringComparison.OrdinalIgnoreCase))
            {
                return System.Windows.Visibility.Visible;
            }

            if (reference.Equals("WHO", StringComparison.OrdinalIgnoreCase) && objectReference.Equals("WHO", StringComparison.OrdinalIgnoreCase))
            {
                return System.Windows.Visibility.Visible;
            }

            return System.Windows.Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
